<% content_for :title do %>线索监听<% end %>

<%= link_to '新建线索监听', new_trigger_path,:class=>'btn btn-primary btn-sm' %>

<%= grid(@triggers) do |g|
    g.action_column  object_property: :id
   
    g.column name: '线索名称', attribute: 'keyword' do |trigger|
      trigger.keyword
    end

    g.column name: '数据类型', attribute: 'data_type' do |trigger|
       trigger.data_type
    end

    g.column name: '数据ID', attribute: 'data_id' do |trigger|
       trigger.data_id
    end

    g.column name: '监听时间',attribute: 'created_at'  do |trigger|
      time_str trigger.created_at
    end

     g.column do |trigger| 
      link_to('编辑', edit_trigger_path(trigger))+"  "+link_to('删除', trigger, method: :delete, data: { confirm: 'Are you sure?' })
    end
end %>
